import { getToken, setToken } from '@/utils/auth'

export default {
  namespaced: true,

  state: {
    // token: getToken() || ''
    token: localStorage.getItem('token') ? localStorage.getItem('token') : ''
  },
  mutations: {
    setToken(state, NewToken) {
      state.token = NewToken
      // setToken(NewToken)
      localStorage.setItem('token', NewToken)
    },
    removeToken(state) {
      state.token = ''
      localStorage.removeItem('token')
    }
  },
  actions: {}
}
